﻿using System;
using System.Windows.Forms;

namespace SneakyWeasel.Engine
{
    abstract public class SWPlugin : ISWPlugin
    {
        #region Plugin Abstract Properties
        public string Name { get { return "SWPlugin"; } }
        public string Description { get { return "Basic Abstract Plugin"; } }
        public Version Version { get { return new Version("1.0"); } }

        public ISWEngine Engine { get; set; }
        #endregion

        #region Plugin API Abstract Events
        public virtual void OnLoad()
        {
        }

        public virtual void OnLoad(ISWEngine sw)
        {
            OnLoad();
        }
        
        public virtual void OnLoad(ISWEngine sw, Form f)
        {
            OnLoad(sw);
        }

        public virtual void OnPulse()
        {
        }

        public virtual void OnPulse(ISWEngine sw)
        {
            OnPulse();
        }

        public virtual void OnPulse(ISWEngine sw, Form f)
        {
            OnPulse(sw);
        }

        public virtual void OnUnload()
        {
        }

        public virtual void OnUnload(ISWEngine sw)
        {
            OnUnload();
        }

        public virtual void OnUnload(ISWEngine sw, Form f)
        {
            OnUnload(sw);
        }

        public virtual void OnStart()
        {
        }

        public virtual void OnStart(ISWEngine sw)
        {
            OnStart();
        }

        public virtual void OnStart(ISWEngine sw, Form f)
        {
            OnStart(sw);
        }

        public virtual void OnStop()
        {
        }

        public virtual void OnStop(ISWEngine sw)
        {
            OnStop();
        }

        public virtual void OnStop(ISWEngine sw, Form f)
        {
            OnStop(sw);
        }
        #endregion
    }

    public interface ISWPlugin
    {
        #region Plugin Interface Properties
        string Name { get; }
        string Description { get; }
        Version Version { get; }

        ISWEngine Engine { get; set; }
        #endregion

        #region Plugin API Interface Events
        void OnLoad();
        void OnLoad(ISWEngine sw);
        void OnLoad(ISWEngine sw, Form f);

        void OnUnload();
        void OnUnload(ISWEngine sw);
        void OnUnload(ISWEngine sw, Form f);

        void OnPulse();
        void OnPulse(ISWEngine sw);
        void OnPulse(ISWEngine sw, Form f);

        void OnStart();
        void OnStart(ISWEngine sw);
        void OnStart(ISWEngine sw, Form f);

        void OnStop();
        void OnStop(ISWEngine sw);
        void OnStop(ISWEngine sw, Form f);
        #endregion
    }
}
